#include "comm.h"
#include <string.h>

int main()
{

  int fd=open(MY_FIFO,O_WRONLY);
  if(fd<0)
  {
    perror("open");
    return 1;
  }

  while(1)
  {
    char buffer[64]={0};

    ssize_t s=read(0,buffer,sizeof(buffer)-1);
    if(s>0)
    {
      buffer[s]=0;
      printf("%s\n",buffer);

      write(fd,buffer,strlen(buffer));
    }
  }
  close(fd);
  return 0;

}
